﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using System.Web;



using Controller;
using Model;

namespace WPFGUI
{
    /// <summary>
    /// Interaction logic for Window1.xaml
    /// </summary>
    public partial class Login : Window
    {
        // instancere controlleren så den er ens overalt.
        Controller.Controller wilkesystem;


        public Login(Controller.Controller wilkesystem)
        {
            InitializeComponent();
            this.wilkesystem = wilkesystem;
        }

        private void button1_Click(object sender, RoutedEventArgs e)
        {
            wilkesystem.BrugerLogin(txtUser.Text, txtPass.Password);

            if (wilkesystem.loginBruger != null)
            {
                MessageBox.Show("Du er logget ind.");
                this.Close();
            }
            else
            {
                MessageBox.Show("Forkert email eller kode.");
            }
        }
    }
}
